<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http:www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<include file="./Home/Tpl/Admin/Common/cssjs.html" />
</head>
<body>
<div class="pad-10">
  <form name="searchform" action="{:U("Contents/Content/public_relationlist")}" method="get" >
    <input type="hidden" value="Contents" name="g">
    <input type="hidden" value="Content" name="m">
    <input type="hidden" value="public_relationlist" name="a">
    <input type="hidden" value="{$modelid}" name="modelid">
    <table width="100%" cellspacing="0" class="search-form">
      <tbody>
        <tr>
          <td align="center"><div class="explain-col">
              <select name="field">
                <option value='title' <if condition=" $_GET['field']=='title' ">selected</if>>标题</option>
                <option value='keywords' <if condition=" $_GET['field']=='keywords' ">selected</if> >关键字</option>
                <option value='description' <if condition=" $_GET['field']=='description' ">selected</if>>描述</option>
                <option value='id' <if condition=" $_GET['field']=='id' ">selected</if>>ID</option>
              </select>
              {$Formcategory}
              <input name="keywords" type="text" value="{$Think.get.keywords}" style="width:330px;" class="input-text" />
              <input type="submit" name="dosubmit" class="button" value="搜索" />
            </div></td>
        </tr>
      </tbody>
    </table>
  </form>
  <div class="table-list">
    <table width="100%" cellspacing="0" >
      <thead>
        <tr>
          <th >标题</th>
          <th width="100">所属栏目</th>
          <th width="100">添加时间</th>
        </tr>
      </thead>
      <tbody>
        <volist name="data" id="r">
        <tr onclick="select_list(this,'{$r.title}',{$r.id})" class="cu" title="点击选择">
          <td align='left' >{$r.title}</td>
          <td align='center'>{$r.catid}</td>
          <td align='center'>{$r.inputtime}</td>
        </tr>
        </volist>
      </tbody>
    </table>
    <div id="pages">{$page}</div>
  </div>
</div>
<style type="text/css">
 .line_ff9966,.line_ff9966:hover td{
	background-color:#FF9966;
}
 .line_fbffe4,.line_fbffe4:hover td {
	background-color:#fbffe4;
}
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
	function select_list(obj,title,id) {
		var relation_ids = window.top.$('#relation').val();
		var sid = 'v{$modelid}'+id;
		if($(obj).attr('class')=='line_ff9966' || $(obj).attr('class')==null) {
			$(obj).attr('class','line_fbffe4');
			window.top.$('#'+sid).remove();
			if(relation_ids !='' ) {
				var r_arr = relation_ids.split('|');
				var newrelation_ids = '';
				$.each(r_arr, function(i, n){
					if(n!=id) {
						if(i==0) {
							newrelation_ids = n;
						} else {
						 newrelation_ids = newrelation_ids+'|'+n;
						}
					}
				});
				window.top.$('#relation').val(newrelation_ids);
			}
		} else {
			$(obj).attr('class','line_ff9966');
			var str = "<li id='"+sid+"'>·<span>"+title+"</span><a href='javascript:;' class='close' onclick=\"remove_relation('"+sid+"',"+id+")\"></a></li>";
			window.top.$('#relation_text').append(str);
			if(relation_ids =='' ) {
				window.top.$('#relation').val(id);
			} else {
				relation_ids = relation_ids+'|'+id;
				window.top.$('#relation').val(relation_ids);
			}
		}
}
//-->
</SCRIPT>
</body>
</html>